import { FormType, ViewBase } from "../Framework/Core/ViewBase";
import { CtrlBase } from "../Framework/Core/CtrlBase";
import { LoginView } from "./UI/Login/LoginView";
import { LoginCtrl } from "./UI/Login/LoginCtrl";
import { HomeCtrl } from "./UI/Home/HomeCtrl";
import { HomeView } from "./UI/Home/HomeView";
import { Constructor } from "../3rd/ECS/__private";
import { ClassFactory } from "../Framework/Collections/Factory";


interface CtrlConfig 
{
    ctrlFactory:ClassFactory<CtrlBase>;
    path:string;
    viewFactory:ClassFactory<ViewBase>;
    formType:FormType
}


const CtrlName =
{
    Login:"Login",
    Home:"Home",
}

export class CtrlConstruction<T extends CtrlBase>
{
    // public NewCtrl<T>(cls: (...args: any[]) => T, ...args: any[]):T { 
    //     return new cls(...args);
    //     }


}


export class UIConfig 
{
    static configs:Record<string,CtrlConfig> = {};
    static Init()
    {   
        // var aa = new  LoginCtrl();

        UIConfig.configs[CtrlName.Login] = {ctrlFactory:new ClassFactory(LoginCtrl) ,path:"UILogin",viewFactory :new ClassFactory(LoginView),formType:FormType.Normal}
        UIConfig.configs[CtrlName.Home] = {ctrlFactory:new ClassFactory(HomeCtrl) ,path:"UIHome",viewFactory : new ClassFactory(HomeView),formType:FormType.Normal}
    }

 


}

export default CtrlName;